﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SudoForm
{
    class UnusedSaveData
    {
        public UnusedSaveData(string data)
        {
            string path = @"D:\Code\Sudo\SudoData.json";

            if (File.Exists(path))
            {
                File.Delete(path);
            }
            using (FileStream fs = File.Create(path))
            {
                AddText(fs, data);
                fs.Close();
            }
        }
        private static void AddText(FileStream fs, string value)
        {
            byte[] info = new UTF8Encoding(true).GetBytes(value);
            fs.Write(info, 0, info.Length);
        }
    }
}


/*if (!(File.Exists(SudoData)))
{
    FileStream file = new FileStream(SudoData, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
    StreamWriter write = new StreamWriter(file);
    write.WriteLine(data);
}*/